package date_;

import java.text.DateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.Date;

/**
 * @author wly
 * @version V1.0.0
 * @date 2022/12/24 10:37
 */
public class LocalDate_ {
    public static void main(String[] args) {
//        LocalDate localDate = new LocalDate(1999, 11, 30);
        LocalDate d1 = LocalDate.now();
        LocalDateTime d2 = LocalDateTime.now();
        System.out.println(d1);
        System.out.println(d2);
        System.out.println(d2.getDayOfMonth());
        System.out.println(d2.getMonth());
        System.out.println(d2.getMonthValue());
        LocalDateTime d3 = d2.plusDays(100);
        System.out.println(DateTimeFormatter.ofPattern("yyyy年MM月dd日 hh:mm:ss").format(d3));
        DateFormat instance = DateFormat.getDateInstance();
        String format = instance.format(new Date());
        System.out.println(format);
    }
}
